home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1986 March
/
1986-03.d64
/
key to joy demo
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
46 lines
1 print"[147][159]to use a joystick with this program"
2 print"you must first load the menu and run"
3 print"'power basic - keyboard to joystick'[159]."
4 print"when prompted for the key's used enter"
5 print"i[159],m[159],j[159],k[159] for up/down/left/right and any"
6 print"key for the firebutton. then load and"
7 print"run 'mn[159]' to reload the menu."
8 print" press 'm'[159] to reload the menu"
9 print" press any other key to run the demo"
10 poke198,0:wait198,1:getmt$:ifmt$=""then10
11 ifmt$<>"m"then100
15 poke53280,14:poke53281,14:print"[147][154]load";chr$(34);"nt";chr$(34);",8"
16 a$=chr$(13)+"run"+chr$(13)
17 fori=1tolen(a$):poke630+i,asc(mid$(a$,i)):next:poke198,i-1
18 new
99 stop
100 poke53281,6:print"[147][159]"tab(16)"*** key to joy demo ***":a=rnd(0)
110 poke53280,0:poke53281,0:fori=0to19:poke1083-i,160:poke1084+i,160:nexti
120 fori=0to21:poke1104+i*40,160:poke1143+i*40,160:nexti
130 fori=0to19:poke1984+i,160:poke2023-i,160:nexti
140 dims(999):wh=292:wt=wh:d=1:pokewh+1024,81:s(wh)=d:gosub320:gosub350
150 geta$:d1=d
160 ifa$="j"thend=-1
170 ifa$="k"thend=1
180 ifa$="i"thend=-40
190 ifa$="m"thend=40
200 ifd=-d1thend=d1
210 s(wh)=d:wh=wh+d
220 ifpeek(wh+1024)=65thensc=sc+10:gosub350:gosub320:gosub320:l=5:goto240
230 ifpeek(wh+1024)<>32then270
240 pokewh+1024,81:iflthenl=l-1:goto260
250 pokewt+1024,32:wt=wt+s(wt)
260 fort=1to25:nextt:goto150
270 p=peek(wh+1024):pokewh+1024,86:print:print:printtab(2)chr$(18)"you ran ";
280 ifp=81thenprint"over yourself"
290 ifp=160thenprint"into a wall"
300 print:printtab(2)chr$(18)"game over"
302 printspc(6)"press any key to play again"
305 poke198,0:wait198,1:getmt$:ifmt$=""then305
306 run100
310 rem *** grow mushrooms ***
320 r=int(rnd(1)*960)+1064:ifpeek(r)<>32then320
330 poker,65:return
340 rem *** print score ***
350 printchr$(19)"score: "right$("0000"+mid$(str$(sc),2),5):return